package pos.utils;

import java.util.HashMap;

/**
 * 字符串资源库
 * @author plus
 */
public class StringRes {
    public static final int ENGLISH=0, ZHCN=1;
    private static int currentLanguage;
    private static HashMap<Integer,HashMap <String,String>> StringTable=null;

    public static void init() {
        StringTable=new HashMap<Integer,HashMap <String,String>> ();
        HashMap<String,String> EnghishTable=new HashMap<String,String>();
            EnghishTable.put("AppTitle", "Pulse of Shanghai svn119");
        StringTable.put(ENGLISH,EnghishTable );
        
        HashMap<String,String> ZHCNTable=new HashMap<String,String>();
            ZHCNTable.put("AppTitle", "申城脉动 Live Demo");
        StringTable.put(ZHCN,ZHCNTable );
    }
    
    public static int languageChangeTo(int LanguageID){
        if(StringTable==null) init();
        currentLanguage=LanguageID;
        return currentLanguage;
    }
    
    public static String getString(String Key){
        if(StringTable==null) init();
        HashMap <String,String> LanguageMap=StringTable.get(currentLanguage);
        String res=LanguageMap.get(Key);
        return res;
    }
}
